package com.xuecheng.media.controller;

import com.xuecheng.api.media.model.MediaAuditApi;
import com.xuecheng.api.media.model.qo.QueryAuditMediaModel;
import com.xuecheng.api.media.model.qo.QueryMediaModel;
import com.xuecheng.common.domain.page.PageRequestParams;
import com.xuecheng.common.domain.page.PageVO;
import com.xuecheng.media.service.MediaService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 媒资信息 前端控制器
 * </p>
 *
 * @author itcast
 */
@Slf4j
@RestController
public class MediaAuditController implements MediaAuditApi {

    @Autowired
    private MediaService  mediaService;

    public static final Long COMPANY = -1122354L;

    /**
     * 查询媒资信息-运营
     * @param params
     * @param model
     * @return
     */
    @Override
    @PostMapping("m/media/list")
    public PageVO selectMedia(PageRequestParams params, @RequestBody QueryMediaModel model) {


        return mediaService.selectMedia(params,model,COMPANY);
    }


    /**
     * 修改审核状态-运营
     * @param model QueryAuditMediaModel
     */
    @Override
    @PutMapping("m/media/audit")
    public void selectAuditMedia(@RequestBody QueryAuditMediaModel model) {

        mediaService.selectAuditMedia(model);
    }

}
